package com.aierjun.mainview.Sample;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.View;

import com.aierjun.mainview.R;
import com.aierjun.mainview.view.MainView;

/**
 * Created by Ani_aierJun on 2017/11/6.
 */

public class TestMainViewSample extends FragmentActivity implements MainView.OnItemIdClickListener{

private String[] text = {"one", "two", "three", "four"};
private int[] mipmap = {R.drawable.round_add, R.drawable.mudidi, R.drawable.zonghe, R.drawable.zhinengyouhua};
private int[] mipmapCheck = {R.drawable.round_add, R.drawable.mudidi, R.drawable.zonghe, R.drawable.zhinengyouhua};
private int[] ids={R.id.one,R.id.two,R.id.three,R.id.four};
private Fragment[] fragments={OneFragment.getInstance(), TwoFragment.getInstance(), ThreeFragment.getInstance(), FourFragment.getInstance()};

private MainView mainView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mainView=new MainView(this);
        View view=mainView.setItemText(text)
                .setFragment(fragments)
                .setItemUnCheckMipmap(mipmap)
                .setItemCheckMipmap(mipmapCheck)
                .setItemCheckTextColor(R.color.result_view)
                .setItemUnCheckTextColor(R.color.viewfinder_mask)
                .setItemBackgroundColor(R.color.white)
                .setIds(ids)
                .setOnItemIdClickListener(this)
                .setImagePadding(0,15,0,8)
                .setTextPadding(0,2,0,10)
                .setDefaultCheck(true,0)
                .initView();
        setContentView(view);


    }

    @Override
    public void onClickListenrt(int position, View view) {

        if (position ==1 ){

        }
        if (position == 2){

        }

    }
}

